<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Text Rotator" />
  <Content type="html">
     <![CDATA[
       <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">



(function($){
    $.fn.extend({ 
        //plugin name - rotaterator
        rotaterator: function(options) {
 
            var defaults = {
                fadeSpeed: 600,
                pauseSpeed: 100,
				child:null
            };
             
            var options = $.extend(defaults, options);
         
            return this.each(function() {
                  var o =options;
                  var obj = $(this);                
                  var items = $(obj.children(), obj);
				  items.each(function() {$(this).hide();})
				  if(!o.child){var next = $(obj).children(':first');
				  }else{var next = o.child;
				  }
				  $(next).fadeIn(o.fadeSpeed, function() {
						$(next).delay(o.pauseSpeed).fadeOut(o.fadeSpeed, function() {
							var next = $(this).next();
							if (next.length == 0){
									next = $(obj).children(':first');
							}
							$(obj).rotaterator({child : next, fadeSpeed : o.fadeSpeed, pauseSpeed : o.pauseSpeed});
						})
					});
            });
        }
    });
})(jQuery);

 $(document).ready(function() {
        $('#rotate').rotaterator({fadeSpeed:1200, pauseSpeed:6000});
    }); 

</script>



<div id="rotate">
	<div>
		<h1>Text 1</h1>
	</div>
	<div>
		<h1>Text 2</h1>
	</div>
	<div>
		<h1>Text 3</h1>
		</div>
	<div>
		<h1>Text 4</h1>
	</div>
</div>
     ]]>

  </Content>
</Module>


